const router = require('koa-router')()
const message = require('../api/message')
router.prefix('/message')
// #region
/**
 * @swagger
 * /message/getList 获取系统公告列表:
 *   get:
 *     description: 获取系统公告列表
 *     tags: [系统公告模块]
 *     parameters:
 *       - name: page
 *         description: 页码
 *         in: formData
 *         required: true
 *         type: number
 *       - name: size
 *         description: 页数
 *         in: formData
 *         required: true
 *         type: number
 *     responses:
 *       0:
 *         description: 成功
 *         schema:
 *           type: object
 *           $ref: '#/definitions/success'
 *       -1:
 *         description: 失败
 *         schema:
 *           type: object
 *           $ref: '#/definitions/fail'
 */
// #endregion
router.get('/getList', message.getList)
// #region
/**
 * @swagger
 * /message/modifyShow 修改默认使用的通知:
 *   post:
 *     description: 修改默认使用的通知
 *     tags: [系统公告模块]
 *     produces:
 *       - application/json
 *     parameters:
 *       - name: id
 *         description: id
 *         in: formData
 *         required: true
 *         type: number
 *       - name: isShow
 *         description: 是否使用显示
 *         in: formData
 *         required: true
 *         type: boolean
 *     responses:
 *       0:
 *         description: 成功
 *         schema:
 *           type: object
 *           $ref: '#/definitions/success'
 *       -1:
 *         description: 失败
 *         schema:
 *           type: object
 *           $ref: '#/definitions/fail'
 */
// #endregion
router.post('/modifyShow', message.modifyShow)
// #region
/**
 * @swagger
 * /message/delete 删除通知:
 *   delete:
 *     description: 删除通知
 *     tags: [系统公告模块]
 *     produces:
 *       - application/json
 *     parameters:
 *       - name: id
 *         description: id
 *         in: formData
 *         required: true
 *         type: number
 *     responses:
 *       0:
 *         description: 成功
 *         schema:
 *           type: object
 *           $ref: '#/definitions/success'
 *       -1:
 *         description: 失败
 *         schema:
 *           type: object
 *           $ref: '#/definitions/fail'
 */
// #endregion
router.delete('/delete', message.delete)
module.exports = router